<!--
 * @Author: 吴竹叶 2107206923@qq.com
 * @Date: 2023-10-09 15:49:45
 * @LastEditors: 赵天利 5450026+zhaotianli01@user.noreply.gitee.com
 * @LastEditTime: 2024-01-26 11:04:27
 * @FilePath: \BZ_JT_AnQuanHuanBaoGuanLiApp\src\views\staging\commom\AccidentEvents\components\environment\punishDetail.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="py-1 px-1 bg-white">
    <div class="baseLoad">
      <div v-for="(item, index) in descList" :key="index">
        <custom-details-item :icon="item.icon" :label="item.label" :value="item.value + ''">
          <template #valueSlot>
            <div v-if="!item.isFile" class="desContent">{{ item.value }}</div>
            <div v-else class="value">
              <el-link type="primary" @click="openAttachPopUp(item.value)">查看</el-link>
            </div>
          </template>
        </custom-details-item>
      </div>
    </div>
    <attachPopUp ref="attachPopUp" />
  </div>
</template>

<script>
import { punishDetails } from '@/api/commonPage/AccidentEvents'
import commonList from '@/assets/mixin/commonList'

export default {
  mixins: [commonList],
  data() {
    return {
      current: '',
      companyId: '',
      companyName: '',
      descList: [
        { field: 'companyName', label: '企业名称', value: '', icon: '&#xe790;' },
        { field: 'decisionNumber', label: '决定书文号', value: '', icon: '&#xe790;' },
        { field: 'punishYear', label: '处罚年度', value: '', icon: '&#xe790;' },
        { field: 'punishItem', label: '处罚事项', value: '', icon: '&#xe790;' },
        { field: 'punishMoney', label: '罚款金额（万元）', value: '', icon: '&#xe790;' },
        { field: 'punishType', label: '处罚种类', value: '', icon: '&#xe790;' },
        { field: 'punishAccording', label: '处罚依据', value: '', icon: '&#xe611;' },
        { field: 'settleLawsuit', label: '结案情况', value: '', icon: '&#xe611;' },
        { field: 'fillTime', label: '填报时间', value: '', icon: '&#xe611;' },
        { field: 'shareAttachVos', isFile: true, label: '附件', value: '下载', icon: '&#xe692;' }
      ],
      factoryImgList: []
    }
  },
  async mounted() {
    const { current, id, active } = this.$route.query
    // this.layout.showLoading()
    this.layout.showAreaLoading(['.baseLoad'])
    this.id = id || ''
    this.current = current || ''
    const { data, status } = await punishDetails({ [active === '环境事件' ? 'environmentEventId' : 'punishId']: id })
    if (status === 0 && data) {
      this.descList.forEach(v => {
        v.value = data[v.field] ? data[v.field] : v.value
      })
    }
    this.layout.hideAreaLoading(['.baseLoad'])
    // this.layout.hideLoading()
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
.desContent {
  line-height: 0.533rem;
}
</style>
